Java Patterns

  1. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=1; i<=5; i++) {
    			for(int j=1; j<=5; j++) {
    				System.out.print("*");
    			}
    		System.out.println();
    		}
    	}
    }
    

  2. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=1; i<=5; i++) {
    			for(int j=1; j<=5; j++) {
    				System.out.print(i);
    			}
    		System.out.println();
    		}
    	}
    }
    

  3. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=1; i<=5; i++) {
    			for(int j=1; j<=5; j++) {
    				System.out.print(j);
    			}
    		System.out.println();
    		}
    	}
    }
    

  4. public class Patterns {
    	public static void main(String[] args) {
    		for(char i='A'; i<='E'; i++) {
    			for(char j='A'; j<='E'; j++) {
    				System.out.print(i);
    			}
    		System.out.println();
    		}
    	}
    }
    

  5. public class Patterns {
    	public static void main(String[] args) {
    		for(char i='A'; i<='E'; i++) {
    			for(char j='A'; j<='E'; j++) {
    				System.out.print(j);
    			}
    		System.out.println();
    		}
    	}
    }
    

  6. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=5; i>=1; i--) {
    			for(int j=1; j<=5; j++) {
    				System.out.print(i);
    			}
    		System.out.println();
    		}
    	}
    }
    

  7. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=5; i>=1; i--) {
    			for(int j=5; j>=1; j--) {
    				System.out.print(j);
    			}
    		System.out.println();
    		}
    	}
    }
    

  8. public class Patterns {
    	public static void main(String[] args) {
    		for(char i='E'; i>='A'; i--) {
    			for(char j='E'; j>='A'; j--) {
    				System.out.print(i);
    			}
    		System.out.println();
    		}
    	}
    }
    

  9. public class Patterns {
    	public static void main(String[] args) {
    		for(char i='E'; i>='A'; i--) {
    			for(char j='E'; j>='A'; j--) {
    				System.out.print(j);
    			}
    		System.out.println();
    		}
    	}
    }
    

  10. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=1; i<=5; i++) {
    			for(int j=1; j<=i; j++) {
    				System.out.print("*");
    			}
    		System.out.println();
    		}
    	}
    }
    

  11. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=1; i<=5; i++) {
    			for(int j=1; j<=i; j++) {
    				System.out.print(i);
    			}
    		System.out.println();
    		}
    	}
    }
    

  12. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=1; i<=5; i++) {
    			for(int j=1; j<=i; j++) {
    				System.out.print(j);
    			}
    		System.out.println();
    		}
    	}
    }
    

  13. public class Patterns {
    	public static void main(String[] args) {
    		for(char i='A'; i<='E'; i++) {
    			for(char j='A'; j<=i; j++) {
    				System.out.print(i);
    			}
    		System.out.println();
    		}
    	}
    }
    

  14. public class Patterns {
    	public static void main(String[] args) {
    		for(char i='A'; i<='E'; i++) {
    			for(char j='A'; j<=i; j++) {
    				System.out.print(j);
    			}
    		System.out.println();
    		}
    	}
    }
    

  15. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=1; i<=5; i++) {
    			for(int j=5; j>=i; j--) {
    				System.out.print("*");
    			}
    		System.out.println();
    		}
    	}
    }
    

  16. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=1; i<=5; i++) {
    			for(int j=5; j>=i; j--) {
    				System.out.print(i);
    			}
    		System.out.println();
    		}
    	}
    }
    

  17. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=5; i>=1; i--) {
    			for(int j=1; j<=i; j++) {
    				System.out.print(j);
    			}
    		System.out.println();
    		}
    	}
    }
    

  18. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=0; i<=4; i++) {
    			for(int j=4; j>=i; j--) {
    				System.out.print((char)(i+65));
    			}
    		System.out.println();
    		}
    	}
    }
    

  19. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=4; i>=0; i--) {
    			for(int j=0; j<=i; j++) {
    				System.out.print((char)(j+65));
    			}
    		System.out.println();
    		}
    	}
    }
    

  20. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=5; i>=1; i--) {
    			for(int j=1; j<=i; j++) {
    				System.out.print(i);
    			}
    		System.out.println();
    		}
    	}
    }
    

  21. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=1; i<=5; i++) {
    			for(int j=5; j>=i; j--) {
    				System.out.print(j);
    			}
    		System.out.println();
    		}
    	}
    }
    

  22. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=4; i>=0; i--) {
    			for(int j=0; j<=i; j++) {
    				System.out.print((char)(i+65));
    			}
    		System.out.println();
    		}
    	}
    }
    

  23. public class Patterns {
    	public static void main(String[] args) {
    		for(int i=0; i<=4; i++) {
    			for(int j=4; j>=i; j--) {
    				System.out.print((char)(j+65));
    			}
    		System.out.println();
    		}
    	}
    }
    

  24. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=1; i<=n; i++) {
    			for(int j=n-1; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=1; k<=i; k++) {
    				System.out.print("*");
    			}
    		System.out.println();
    		}
    	}
    }
    

    public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=1; i<=n; i++) {
    			for(int j=n; j>=1; j--) {
    				if(i>=j) {
    					System.out.print("*");
    				}
    				else {
    					System.out.print(" ");
    				}
    			}
    		System.out.println();
    		}
    	}
    }
    

  25. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=1; i<=n; i++) {
    			for(int j=n-1; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=1; k<=i; k++) {
    				System.out.print(i);
    			}
    		System.out.println();
    		}
    	}
    }
    

  26. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=1; i<=n; i++) {
    			for(int j=n-1; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=1; k<=i; k++) {
    				System.out.print(k);
    			}
    		System.out.println();
    		}
    	}
    }
    

  27. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=0; i<n; i++) {
    			for(int j=n-1; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=0; k<=i; k++) {
    				System.out.print((char)(i+65));
    			}
    		System.out.println();
    		}
    	}
    }
    

  28. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=0; i<n; i++) {
    			for(int j=n-1; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=0; k<=i; k++) {
    				System.out.print((char)(k+65));
    			}
    		System.out.println();
    		}
    	}
    }
    

  29. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=n; i>=1; i--) {
    			for(int j=n-1; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=1; k<=i; k++) {
    				System.out.print("*");
    			}
    		System.out.println();
    		}
    	}
    }
    

  30. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=n; i>=1; i--) {
    			for(int j=n-1; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=1; k<=i; k++) {
    				System.out.print(i);
    			}
    		System.out.println();
    		}
    	}
    }
    

  31. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=n; i>=1; i--) {
    			for(int j=n-1; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=1; k<=i; k++) {
    				System.out.print(k);
    			}
    		System.out.println();
    		}
    	}
    }
    

  32. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=n-1; i>=0; i--) {
    			for(int j=n-1; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=0; k<=i; k++) {
    				System.out.print((char)(i+65));
    			}
    		System.out.println();
    		}
    	}
    }
    

  33. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=n-1; i>=0; i--) {
    			for(int j=n-1; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=0; k<=i; k++) {
    				System.out.print((char)(k+65));
    			}
    		System.out.println();
    		}
    	}
    }
    

  34. public class Patterns {
    	public static void main(String[] args) {
    		int min_stars=1;
    		int p_height=5;
    		int p_space=p_height-1;
    		for(int i=0; i<p_height; i++){
    			for(int j=p_space; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=0; k<min_stars; k++) {
    				System.out.print("*");
    			}
    			min_stars+=2;
    		System.out.println();
    		}
    	}
    }
    

  35. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		int z=1;
    		for(int i=0; i<n; i++) {
    			for(int j=n-1; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=0; k<z; k++) {
    				System.out.print(z-i);
    			}
    			z+=2;
    		System.out.println();
    		}
    	}
    }
    

  36. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		int z=1;
    		for(int i=0; i<n; i++) {
    			for(int j=n-1; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=0; k<z; k++) {
    				System.out.print(z);
    			}
    			z+=2;
    		System.out.println();
    		}
    	}
    }
    

  37. public class Patterns {
    	public static void main(String[] args) {
    		int m=1;
    		int p_height=5;
    		int p_space=p_height-1;
    		for(int i=0; i<p_height; i++) {
    			for(int j=p_space; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=0; k<m; k++) {
    				System.out.print((char)(i+65));
    			}
    			m+=2;
    		System.out.println();
    		}
    	}
    }
    

  38. public class Patterns {
    	public static void main(String[] args) {
    		int m=0;
    		int p_height=5;
    		int p_space=p_height-1;
    		for(int i=0; i<p_height; i++) {
    			for(int j=p_space; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=0; k<=m; k++) {
    				System.out.print((char)(m+65));
    			}
    			m+=2;
    		System.out.println();
    		}
    	}
    }
    

  39. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		int z=1;
    		for(int i=0; i<n; i++) {
    			for(int j=n-1; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=1; k<=z; k++) {
    				System.out.print(k);
    			}
    			z+=2;
    		System.out.println();
    		}
    	}
    }
    

  40. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		int z=1;
    		for(int i=1; i<=n; i++) {
    			for(int j=n-1; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=z; k>=1; k--) {
    				System.out.print(k);
    			}
    			z+=2;
    		System.out.println();
    		}
    	}
    }
    

  41. public class Patterns {
    	public static void main(String[] args) {
    		int m=1;
    		int p_height=5;
    		int p_space=p_height-1;
    		for(int i=0; i<p_height; i++) {
    			for(int j=p_space; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=0; k<m; k++) {
    				System.out.print((char)(k+65));
    			}
    			m+=2;
    		System.out.println();
    		}
    	}
    }
    

  42. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		int z=0;
    		for(int i=0; i<n; i++) {
    			for(int j=n-1; j>i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=0; k<=z; k++) {
    				System.out.print((char)(z-k+65));
    			}
    			z+=2;
    		System.out.println();
    		}
    	}
    }
    

  43. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		int z=1;
    		for(int i=1; i<=n; i++) {
    			for(int j=n-1; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=z; k>=1; k--) {
    				System.out.print(Math.abs(k-i));
    			}
    			z+=2;
    		System.out.println();
    		}
    	}
    }
    

  44. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		int z=1;
    		for(int i=1; i<=n; i++) {
    			for(int j=n-1; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=z; k>=1; k--) {
    				System.out.print((char)(Math.abs(k-i)+65));
    			}
    			z+=2;
    		System.out.println();
    		}
    	}
    }
    

  45. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=1; i<=n; i++) {
    			for(int j=n-1; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=i-1; k>=-(i-1); k--) {
    				System.out.print(i-Math.abs(k));
    			}
    		System.out.println();
    		}
    	}
    }
    

  46. public class Patterns {
    	public static void main(String[] args) {
    		int n=5;
    		for(int i=0; i<n; i++) {
    			for(int j=n-1; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=i; k>=-i; k--) {
    				System.out.print((char)(i-Math.abs(k)+65));
    			}
    		System.out.println();
    		}
    	}
    }
    

  47. public class Patterns {
    	public static void main(String[] args) {
    		int p_height=5;
    		int max_stars=p_height*2-1;
    		int p_space=p_height-1;
    		for(int i=p_height; i>=1; i--) {
    			for(int j=p_space; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=1; k<=max_stars; k++) {
    				System.out.print("*");
    			}
    			max_stars-=2;
    		System.out.println();
    		}
    	}
    }
    

  48. public class Patterns {
    	public static void main(String[] args) {
    		int p_height=5;
    		int max_stars=p_height*2-1;
    		int p_space=p_height-1;
    		for(int i=p_height; i>=1; i--) {
    			for(int j=p_space; j>=i; j--) {
    				System.out.print(" ");
    			}
    			for(int k=1; k<=max_stars; k++) {
    				System.out.print(i);
    			}
    			max_stars-=2;
    		System.out.println();
    		}
    	}
    }